<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>HTTP 协议深度解析</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
        }
        .serif-font {
            font-family: 'Noto Serif SC', serif;
        }
        .gradient-bg {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
        }
        .status-badge {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 9999px;
            font-size: 0.875rem;
            font-weight: 500;
        }
        .first-letter::first-letter {
            font-size: 3.5rem;
            font-weight: 700;
            float: left;
            line-height: 1;
            margin-right: 0.5rem;
            color: #667eea;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="gradient-bg text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center animate-fadeInUp">
            <h1 class="text-5xl md:text-7xl font-bold mb-6 serif-font">HTTP 协议深度解析</h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">探索互联网通信的基石，理解客户端与服务器之间的对话艺术</p>
            <div class="flex justify-center space-x-4">
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-network-wired mr-2"></i> 网络协议
                </span>
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-code mr-2"></i> 技术核心
                </span>
                <span class="inline-flex items-center px-4 py-2 bg-white bg-opacity-20 rounded-full">
                    <i class="fas fa-server mr-2"></i> 架构基础
                </span>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto">
            <div class="bg-white rounded-2xl shadow-xl p-8 md:p-12">
                <p class="text-lg leading-relaxed text-gray-700 first-letter">
                    HTTP（超文本传输协议）是现代互联网的基础协议，它定义了客户端和服务器之间的通信规则。从简单的网页浏览到复杂的 API 调用，HTTP 协议无处不在。本文将深入剖析 HTTP 协议的核心组成部分，帮助您全面理解这一互联网通信的基石。
                </p>
            </div>
        </div>
    </section>

    <!-- Protocol Structure Visualization -->
    <section class="py-16 px-6 bg-gray-100">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-4xl font-bold text-center mb-12 text-gradient">协议结构可视化</h2>
            <div class="bg-white rounded-2xl shadow-xl p-8">
                <div class="mermaid">
                    graph TB
                        A[HTTP 协议] --> B[请求 Request]
                        A --> C[响应 Response]
                        B --> D[请求行]
                        B --> E[请求头]
                        B --> F[请求体]
                        C --> G[状态行]
                        C --> H[响应头]
                        C --> I[响应体]
                        D --> J[请求方法]
                        D --> K[请求目标]
                        D --> L[协议版本]
                        G --> M[协议版本]
                        G --> N[状态码]
                        G --> O[状态描述]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                        style B fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#764ba2,stroke:#fff,stroke-width:2px,color:#fff
                </div>
            </div>
        </div>
    </section>

    <!-- Request and Response -->
    <section class="py-16 px-6">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-4xl font-bold text-center mb-12 text-gradient">请求与响应</h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- Request Card -->
                <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                    <div class="flex items-center mb-6">
                        <i class="fas fa-paper-plane text-3xl text-purple-600 mr-4"></i>
                        <h3 class="text-2xl font-bold">HTTP 请求</h3>
                    </div>
                    
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-terminal text-purple-500 mr-2"></i> 请求行
                            </h4>
                            <p class="text-gray-600 mb-3">包含请求方法、请求目标和协议版本</p>
                            <div class="code-block">
                                <code>GET /index.html HTTP/1.1</code>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-list text-purple-500 mr-2"></i> 请求头
                            </h4>
                            <p class="text-gray-600 mb-3">包含客户端和请求的元信息</p>
                            <div class="code-block">
                                <code>Host: www.example.com<br>User-Agent: Mozilla/5.0<br>Accept: text/html</code>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-database text-purple-500 mr-2"></i> 请求体
                            </h4>
                            <p class="text-gray-600">可选部分，用于发送数据（如 POST 请求）</p>
                        </div>
                    </div>
                </div>
                
                <!-- Response Card -->
                <div class="bg-white rounded-2xl shadow-xl p-8 card-hover">
                    <div class="flex items-center mb-6">
                        <i class="fas fa-reply text-3xl text-indigo-600 mr-4"></i>
                        <h3 class="text-2xl font-bold">HTTP 响应</h3>
                    </div>
                    
                    <div class="space-y-6">
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-check-circle text-indigo-500 mr-2"></i> 状态行
                            </h4>
                            <p class="text-gray-600 mb-3">包含协议版本、状态码和状态描述</p>
                            <div class="code-block">
                                <code>HTTP/1.1 200 OK</code>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-info-circle text-indigo-500 mr-2"></i> 响应头
                            </h4>
                            <p class="text-gray-600 mb-3">包含服务器和响应的元信息</p>
                            <div class="code-block">
                                <code>Content-Type: text/html<br>Content-Length: 1234</code>
                            </div>
                        </div>
                        
                        <div>
                            <h4 class="font-semibold text-lg mb-2 flex items-center">
                                <i class="fas fa-file-code text-indigo-500 mr-2"></i> 响应体
                            </h4>
                            <p class="text-gray-600">实际的数据内容（HTML、JSON、图像等）</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Request Methods -->
    <section class="py-16 px-6 bg-gray-100">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-4xl font-bold text-center mb-12 text-gradient">请求方法</h2>
            
            <div class="grid md:grid-cols-3 lg:grid-cols-4 gap-6">
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-download text-2xl text-green-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">GET</h3>
                    <p class="text-gray-600 text-sm">请求获取资源</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-upload text-2xl text-blue-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">POST</h3>
                    <p class="text-gray-600 text-sm">提交数据创建资源</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-sync text-2xl text-yellow-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">PUT</h3>
                    <p class="text-gray-600 text-sm">更新整个资源</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-trash text-2xl text-red-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">DELETE</h3>
                    <p class="text-gray-600 text-sm">删除指定资源</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-info text-2xl text-purple-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">HEAD</h3>
                    <p class="text-gray-600 text-sm">获取响应头信息</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-indigo-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-cog text-2xl text-indigo-600"></i>
                    </div>
                    <h3 class="font-bold text-lg mb-2">OPTIONS</h3>
                    <p class="text-gray-600 text-sm">获取支持的方法</p>
                </div>
                
                <div class="bg-white rounded-xl p-6 text-center card-hover">
                    <div class="w-16 h-16 bg-pink-100 rounded-full flex items-center justify-center mx-auto mb-4">
                        <i class="fas fa-edit text-2xl text-pink-600"></i>
                    </div>
                    